<nav id="mainnav-container">
    <div id="mainnav">
        <div id="mainnav-menu-wrap">
            <div class="nano">
                <div class="nano-content">
                    <!--Profile Widget-->
                    <div id="mainnav-profile" class="mainnav-profile">
                        <div class="profile-wrap text-center">
                            <div class="pad-btm">
                                <img class="img-circle img-md" src="{{ url_for('static', filename='images/profile-photos.png') }}">
                            </div>
                            <a href="#profile-nav" class="box-block" data-toggle="collapse" aria-expanded="false">
{#                                <span class="pull-right dropdown-toggle">#}
{#                                    <i class="dropdown-caret"></i>#}
{#                                </span>#}
                                <p class="mnp-name">{{ current_user.name }}</p>
                                <span class="mnp-desc">{{ current_user.email }}</span>
                            </a>
                        </div>
{#                        <div id="profile-nav" class="collapse list-group bg-trans">#}
{#                            <a href="#" class="list-group-item">#}
{#                                <i class="fa fa-user icon-lg icon-fw"></i> 简介#}
{#                            </a>#}
{#                            <a href="#" class="list-group-item">#}
{#                                <i class="fa fa-cog icon-lg icon-fw"></i> 设置#}
{#                            </a>#}
{#                            <a href="#" class="list-group-item">#}
{#                                <i class="fa fa-exclamation-circle icon-lg icon-fw"></i> 帮助#}
{#                            </a>#}
{#                            <a href="{{ url_for("users.logout") }}" class="list-group-item">#}
{#                                <i class="fa fa-unlock-alt icon-lg icon-fw"></i> 退出#}
{#                            </a>#}
{#                        </div>#}
                    </div>

                    <ul id="mainnav-menu" class="list-group" style="margin-bottom: 66px">
                        {% for menu in current_user.menus %}
                            <!--顶级菜单-->
                            <li class="list-header">{{ menu.text }}</li>

                            <!--一级菜单-->
                            {% for node in menu.nodes %}
                            <li>
                                <a href="{{ node.uri }}">
                                    <i class="{{ node.icon }}"></i>
                                    <span class="menu-title">{{ node.text }}</span>
                                    <i class="arrow"></i>
                                </a>

                                <!--二级菜单-->
                                <ul class="collapse">
                                    {% for node in node.nodes %}
                                        <li class="{{ node.class }}">
                                            <!--三级菜单-->
                                            {% if node.nodes %}
                                                <a href="{{ node.uri }}">{{ node.text }}<i class="arrow"></i></a>
                                                <ul class="collapse">
                                                    {% for node in node.nodes %}
                                                        <li class="{{ node.class }}"><a href="{{ node.uri }}">{{ node.text }}</a></li>
                                                    {% endfor %}
                                                </ul>
                                            {% else %}
                                                {% if node.uri == "/terminal/ssh/" or node.uri == "/terminal/sftp/" %}
                                                    <a href="{{ node.uri }}" target="_blank">{{ node.text }}</a>
                                                {% else %}
                                                    <a href="{{ node.uri }}">{{ node.text }}</a>
                                                {% endif %}
                                            {% endif %}
                                        </li>
                                    {% endfor %}
                                </ul>
                            </li>
                            {% endfor %}

                            <li class="list-divider"></li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>